{include file="public/header" /}
<body class="bg-white">
    <div class="rg-userinfo">
        <img src="__STATIC__/plugs/weixin/img/img10.png">
    </div>
    <form class="rg-form" id="from">
        <div class="rg-form-item">
            <label for="lg-tel">
                <i class="layui-icon layui-icon-cellphone
                "></i>
            </label>
            <input type="tel" name="phone" id="lg-tel" placeholder="请输入手机号">
        </div>
        <div class="rg-form-item">
            <label for="rg-pas">
                <i class="layui-icon layui-icon-password
                    "></i>
            </label>
            <input type="password" name="password" id="lg-pas" placeholder="请输入密码">
        </div>
        <div class="rg-form-item" style="border:none;">
           <a href="{:url('regist/index')}" class="color-yellow">免费注册</a>
           <a href="{:url('forget_password/index')}">忘记密码？</a>
        </div>
        <div class="rg-form-item"><button class="order-btn" type="submit">登录</button></div>
    </form>
</body>
<script type="text/javascript">
    //登录
    layui.use(['form'],function () {
        var form = layui.form;
    $("#from").submit(function (e) {
        e.preventDefault();
        var formzie = $(this).serialize();
        $.post("{:url('/weixin/login/logins')}",formzie,function (data) {
            if(data.code == 0){
                layer.msg(data.msg);
            }else if(data.code == 3){
                layer.msg(data.msg);
                setTimeout(function () {
                    location.reload();
                },2000);
            }else{
                layer.msg(data.msg);
                /*setTimeout(function () {
                    location.reload();
                },2000);*/
            }
        });
    });
    form.render();
    });
</script>
</html>